<%--
  Created by IntelliJ IDEA.
  User: taohj
  Date: 2014/6/29
  Time: 18:04
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="menu" value="none" scope="request"></c:set>
<c:set var="dashboardMenuTag" value="myorg" scope="request"></c:set>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<!Doctype html>
<html>
<head>
    <base href="<%=basePath%>">
    <title>政府数据开放平台</title>
    <jsp:include page="../../../commons/include.jsp"/>


    <script>
        $(document).ready(function () {


            $("form input[type='button']").on('click', function () {


                var param = util.formToJson($("form"));

                $.post('/front/my/org/role/modify', param, function (result) {

                    if (result.success) {
                        var n = noty({text: result.message,
                            timeout: 800,
                            type: 'success',
                            layout: 'topCenter',
                            callback: {
                                afterClose: function () {
                                    location.href = '/front/my/org/role/list?org=' + $("form input[name=org]").val();
                                }
                            }});
                    } else {
                        var n = noty({text: result.message, type: 'error',
                            layout: 'topCenter'

                        });
                    }
                }, 'json');
            })


        });
    </script>

</head>
<body>


<div class="main">
    <jsp:include page="../../../commons/top.jsp"/>
    <jsp:include page="../../../commons/dashboardMenu.jsp"/>
    <div>
        <div class="left">
            <c:set var="leftMenu" value="role" scope="request"></c:set>
            <jsp:include page="../commons/leftMenu.jsp"/>
        </div>
        <div class="right">
            <form method="post" style="width: 100%;">



                <input type="hidden" name="id" value="${requestScope.role.id}">
                <input type="hidden" name="org" value="${requestScope.role.org.id}">

                <div>
                    <div style="padding: 80px 0 10px 50px;font-size: 14px;font-weight: bold;">更新</div>
                </div>
                <table class="updateTable" width="600" style="margin-top: 0px;">
                    <tr>
                        <td width="60">名称:</td>
                        <td width="300"><input type="text" name="name" value="${requestScope.role.name}"></td>
                    </tr>

                    <tr>
                        <td>简介:</td>
                        <td><textarea name="description" rows="8"
                                      class="form-control">${requestScope.role.description}</textarea></td>
                    </tr>

                    <tr>
                        <td colspan="2" style="text-align: left; padding-left: 250px;"><input type="button" value="保 存">
                        </td>
                    </tr>
                </table>
            </form>
        </div>
    </div>
</div>

<jsp:include page="../../../commons/buttom.jsp"/>

</body>
</html>
